<%= error_messages_for :report_template %>
<% form_for :report_template, :url => report_template_path(@report_template), :html => {:method => :put} do %>
  <label for="report_template_name">Name:</label>
  <%= text_field 'report_template', 'name'  %><br />
  <label for="report_template_tickets_status">Tickets status: </label>
  <%=  select "report_template", "tickets_status",  %w[all open closed]  %><br />
  <label for="report_template_ticket_template"> Ticket template:</label>
  <%= @report_template.ticket_template.name %>
  <br />
  <label for="report_template_order"> Order by:</label>
  <%= select("report_template", "order", ["created_at", "updated_at", "deadline", "created_at DESC", "updated_at DESC", "deadline DESC"])%>
  <br />
   <%= render :partial => "main_fields_form" %>
   <%= render :partial => "note_types_fields" %>
  <br />
  <%= add_search_field_link "Add new condition" %>
  <div id="search_fields">
  <% @report_template.conditions.each do |condition| %>
     <%= render :partial => "search_field", :locals => {:condition => condition} %>
  <% end %>
  </div>
  <br />
  <%= submit_tag "Update" %>
<% end %>

